import 'package:flutter/material.dart';
import 'package:flutter_juwo/ui/utils/progress_view.dart';
import 'package:flutter_juwo/ui/utils/utils.dart';
import 'package:flutter_juwo/common/common_index.dart';

///************************
/// @auther nb
/// @function 选择图片的默认样式
/// @创建日期 2019/7/10 15:39
///************************
class SelectPic {
  static Container selectPic = Container(
    width: ScreenUtil().setWidth(139),
    height: ScreenUtil().setWidth(139),
    padding: EdgeInsets.all(20.0),
    decoration: new BoxDecoration(
      image: DecorationImage(
          image: ExactAssetImage(Utils.getImgPath('icon_pic_dotted'))),
    ),
    child: Image.asset(
      Utils.getImgPath('icon_pic_none'),
      width: ScreenUtil().setWidth(139),
      height: ScreenUtil().setWidth(139),
    ),
  );

  static Container selectHead = Container(
    child: ClipOval(
      child: CachedNetworkImage(
        width: ScreenUtil().setWidth(139),
        height: ScreenUtil().setWidth(139),
        fit: BoxFit.fill,
        imageUrl: '',
        placeholder: (context, url) => new ProgressView(),
        errorWidget: (context, url, error) => Image.asset(
          Utils.getImgPath('icon_default_head'),
          width: ScreenUtil().setWidth(139),
          height: ScreenUtil().setWidth(139),
          fit: BoxFit.fill,
        ),
      ),
    ),
  );
}
